﻿using Avalonia.Controls;
using Avalonia.Interactivity;

namespace LS.Screening.UI.Common.Mvvm
{
    public abstract class AbstractUserControl : UserControl
    {
        protected override void OnLoaded(RoutedEventArgs e)
        {
            base.OnLoaded(e);
        }

        protected override void OnUnloaded(RoutedEventArgs e)
        {
            base.OnUnloaded(e);
        }
    }

    public abstract class AbstractUserControl<VM> : UserControl where VM : ViewModelBase
    {
        public AbstractUserControl()
        {
            DataContext = CommonApplication.GetService<VM>();
        }

        protected override void OnLoaded(RoutedEventArgs e)
        {
            base.OnLoaded(e);
        }

        protected override void OnUnloaded(RoutedEventArgs e)
        {
            base.OnUnloaded(e);
        }
    }
}
